<template>
  <div>
    <!-- 推荐视频 -->
    <div class="tuijianv">
      <div class="title">精选音乐视频</div>
      <div class="videolist">
        <ul>
          <router-link tag="li" v-for="(item,index) in resultMv" :key="index" :to="'/recommend/mvDetails?id='+item.id">
            <div class="Imgs">
              <img :src="item.picUrl" alt="" />
            </div>
            <p>{{item.name}}</p>
          </router-link>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
import {getMv} from "../../api/recommend";
export default {
    data() {
        return {
            resultMv:[],
        }
    },
    methods:{
        getMvFun(){
          getMv().then(data=>{
              // console.log(data)
            this.resultMv = data.result
          })
        },
    },
    created(){
        this.getMvFun()
    }
}
</script>

<style lang="less">
.tuijianv{
    .title{
    font-size: 0.5rem;
    margin-top: 10px;
    font-weight: bold;
    text-indent: 0.5em;
    }
    .videolist {
        width: 100%;
        ul {
            width: 100%;
            white-space: nowrap;
            overflow-x: scroll;
            overflow-y: hidden;
            display: flex;
            align-items: center;
            padding: 0;
            box-sizing: border-box;
            li {
              list-style: none;
              text-align: center;
              padding-left: 10px;
              margin-right: 10px;
              .Imgs {
                width: 180px;
                height: 130px;
                border-radius: 10px;
                overflow: hidden;
                img {
                  width: 100%;
                  height: 100%;
                }
              }
              p{
                font-size: 14px;
                width: 180px;
                height: 30px;
                line-height: 30px;
                text-overflow: ellipsis;
                white-space: nowrap;
                overflow: hidden;
              }
            }
        }
        ul::-webkit-scrollbar {
          display: none;
        }
    }
}


</style>
